package es.uned.dia.james;

public class EventV {
	public String type; // Event type
    public double t; // time
    public double[] x; // plant state 
    
    
    public EventV(double time, double[] error) { 
    	type = "Event";
    	t = time;
    	x = (error != null ) ? error.clone() : null;
    }
    
    // Returns a String representing the Event
    public String toString() {
    	String toReturn = String.format("%s at t=%.3f", type, t);
    	if(x == null) return toReturn;

    	for(int i=0; i<x.length; i++) toReturn += String.format("; %.3f", x[i]);    	
		return toReturn;
    }
}
